package client

import (
	"3-19yk/common/proto/user"
	"context"
)

func OrderAdd(ctx context.Context, req *user.OrderAddReq) (*user.OrderAddResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.OrderAdd(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.OrderAddResp), nil
}
func OrderCall(ctx context.Context, req *user.OrderCallReq) (*user.OrderCallResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.OrderCall(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.OrderCallResp), nil
}
func OrderShow(ctx context.Context, req *user.OrderShowReq) (*user.OrderShowResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.OrderShow(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.OrderShowResp), nil
}
func InCure(ctx context.Context, req *user.InCureReq) (*user.InCureResp, error) {
	client, err := UserClient(ctx, func(ctx context.Context, client user.UserClient) (interface{}, error) {
		login, err := client.InCure(ctx, req)
		if err != nil {
			return nil, err
		}
		return login, nil
	})
	if err != nil {
		return nil, err
	}
	return client.(*user.InCureResp), nil
}
